(function($){"use strict";UNCODE.magicCursor=function(){function delayChangeCursor(cursorType,cursorTitle,cursorBg,delayt_time,dataTitle,fontClass){currentBg!==!1&&cursorBg===!1&&cursorType==="auto"&&($tooltip.css({opacity:0}),delayt_time+=400),clearRequestTimeout(setTime),setTime=requestTimeout(function(){$tooltip.css({opacity:""}),$customCursor.find("> span:first-child").add($tooltip).removeClass("tooltip-boing"),cursorTitle!==""?(fromTitle&&dataTitle==="boing"&&setTimeout(function(){$customCursor.find("> span:first-child").add($tooltip).addClass("tooltip-boing")},5),$cursorSpan.attr("class",fontClass).html(cursorTitle)):cursorType!=="auto"&&$cursorSpan.html(""),$cursorSpan.addClass("in-tooltip"),$customCursor.attr("data-cursor",cursorType),fromTitle?$customCursor.addClass("from-tooltip-title"):$customCursor.removeClass("from-tooltip-title"),cursorBg!==!1?$customCursor.attr("data-bg","transparent"):$customCursor.removeAttr("data-bg"),currentBg=cursorBg,cursorTitle!==""?(fromTitle=!0,$customCursor.attr("data-cursor",cursorType),$customCursor.attr("data-title","true"),$cursorSpan.css({width:""})):(fromTitle=!1,$customCursor.removeAttr("data-title")),spanW=$cursorSpan.outerWidth(),spanW>=maxW&&maxW!==!1?($customCursor.find("> span:first-child").add($tooltip).addClass("max-width"),$customCursor.find("> span:first-child").add($tooltip).add($cursorSpan).css({width:maxW}),spanW=maxW):$customCursor.find("> span:first-child").removeClass("max-width"),spanH=$cursorSpan.outerHeight(),spanW&&spanH&&cursorTitle!==""&&cursorType.indexOf("icon-")>=0?$customCursor.find("> span:first-child").add($tooltip).css({width:spanW,height:spanH}):$customCursor.find("> span:first-child").add($tooltip).removeAttr("style"),$customPilot.length&&$customPilot.attr("data-cursor",cursorType)},delayt_time)}function changeCursor($wrap){$wrap=typeof $wrap=="undefined"?$("body"):$wrap;var href=SiteParameters.custom_cursor_selector!=""?SiteParameters.custom_cursor_selector:"[href], a[data-lbox]",$href=$wrap.find(href),cursorType,cursorTitle="",tooltip_class="",cursorBg=!1;$wrap.filter(":not(.cursor-init)").on("mouseenter.cursor",href,function(e){var $this=$(this).addClass("cursor-init"),$tmb=$this.closest(".tmb"),data_cursor=$this.closest("[data-cursor]").attr("data-cursor")||$this.attr("data-cursor"),cursor_bg=$this.closest("[data-cursor]").attr("data-cursor-transparent")||$this.attr("data-cursor-transparent"),data_title=$this.closest("[data-cursor]").attr("data-cursor-title")||$this.attr("data-cursor-title"),data_class=$this.closest("[data-cursor]").attr("data-tooltip-class")||$this.attr("data-tooltip-class"),custom_text=$this.closest("[data-cursor]").attr("data-tooltip-text")||$this.attr("data-tooltip-text"),$title=$(".t-entry-title",$tmb),is_frontend_editor=$this.closest(".vc_controls").length,hasSrcOrClck=$("[src]",$this).length||$(".t-background-cover",$this).length||$this.closest(".tmb-click-row").length,$parent_cursor=$this.closest('[class*="custom-cursor"]');is_frontend_editor?cursorType="auto":typeof data_cursor!="undefined"&&data_cursor!==""&&hasSrcOrClck?cursorType=data_cursor:$parent_cursor.length?$parent_cursor.hasClass("custom-cursor-light")?cursorType="icon-light":$parent_cursor.hasClass("custom-cursor-diff")?cursorType="icon-diff":$parent_cursor.hasClass("custom-cursor-accent")?cursorType="icon-accent":cursorType="icon-dark":cursorType="pointer",typeof data_title!="undefined"&&data_title!==""?typeof custom_text!="undefined"&&custom_text!==""?cursorTitle=custom_text:(cursorTitle=$title.clone(),$("a",cursorTitle).replaceWith(function(){return this.childNodes}),$("*",cursorTitle).replaceWith(function(){return $(this).removeAttr("class")}),cursorTitle=cursorTitle.html()):cursorTitle="",typeof data_class!="undefined"&&data_class!==""?tooltip_class=data_class:tooltip_class="",cursor_bg=="true"?cursorBg=!0:cursorBg=!1,delayChangeCursor(cursorType,cursorTitle,cursorBg,0,data_title,tooltip_class)}).on("mouseleave.cursor",href,function(e){var outTime=150;currentBg!==!1&&cursorBg===!1&&(outTime=0),delayChangeCursor("auto","",!1,outTime,!1,"")}),$(window).on("disable-hover",function(event){document.addEventListener("mousemove",function(e){mouseEvent=e}),delayChangeCursor("auto",cursorTitle,cursorBg,0,!1,"")}),$(window).on("enable-hover",function(event){if(typeof mouseEvent!="undefined"){var x=mouseEvent.clientX,y=mouseEvent.clientY,elements=document.elementsFromPoint(x,y),$element=$(elements[0]);$element.closest(href).trigger("mouseenter")}})}var $customCursor=$("#uncode-custom-cursor"),$customPilot=$("#uncode-custom-cursor-pilot"),$tooltip=$(".title-tooltip",$customCursor),$cursorSpan=$("> span",$tooltip),currentBg=!1,fromTitle=!1,setTime,mouseEvent,spanW,spanH,maxW=!1;$(window).on("load uncode-custom-cursor uncode-quick-view-loaded",function(event){changeCursor()}),$(document).ajaxComplete(function(event,xhr,settings){changeCursor()}),$(".isotope-container").on("isotope-layout-complete",function(){var $this=$(this);changeCursor($this)})}})(jQuery)